package com.hc.pingtan.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hc.pingtan.model.CommonResult;
import com.hc.pingtan.model.KekeWitkeySpace;
import com.hc.pingtan.service.IKekeWitkeySpaceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author astupidcoder
 * @since 2021-10-26
 */
@Api(tags = "用户接口")
@RestController
@RequestMapping("/keke-user")
public class KekeUserController {
    @Resource
    private IKekeWitkeySpaceService kekeWitkeySpaceService;

    @ApiOperation(value = "根据用户ID获取手机号用户名", notes = "立即对接接口", httpMethod = "POST")
    @PostMapping("queryUserById")
    @ApiImplicitParam(name = "userId", value = "userId")
    public CommonResult<KekeWitkeySpace> queryUserById(@RequestParam("userId") String userId) {
        QueryWrapper<KekeWitkeySpace> queryWrapper = new QueryWrapper();
        queryWrapper.eq("uid", userId);
        KekeWitkeySpace one = kekeWitkeySpaceService.getOne(queryWrapper);
        return CommonResult.<KekeWitkeySpace>builder().result(one).build();
    }
}
